<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<title>Film discuss</title>
	<LINK href="<?echo base_url();?>css/style.css" type="text/css" rel=stylesheet>
	<LINK href="<? echo base_url(); ?>css/form_validator/validationEngine.jquery.css" type="text/css" rel=stylesheet>
		<script type="text/javascript" src="<?echo base_url();?>js/jquery-1.7.1.js"></script>
		<script type="text/javascript" src="<?echo base_url();?>js/jquery.validationEngine.js"></script>
		<script type="text/javascript" src="<?echo base_url();?>js/jquery.form_validator.languages/jquery.validationEngine-ru.js"></script>
</head>
<script>
	$(document).ready(function(){
		$('#addform').validationEngine('attach');
		//console.log($('#loginform'));
		$('input submit').click(function(e){
			if ($('#addform').validationEngine('validate') == true)
			{
				console.log(123);
			}
		});
	});
</script>
<body>
	<div id="container">
		<p id="error">
		<?php
		if (isset($text)) {
			echo "Ахтунг!!!".br();
			echo $text;
		}
		?>
		</p>
		<div id="top">
			<a class="navigation" href="/">Главная </a>
		<?php
			if (isset($is_auth) && ($is_auth == 1)) {
				echo "<b class='auth1'>$email</b><a class='auth' href='/main_contr/logoff'>Выйти</a>";
			}
			else {
				echo "<a class='auth' href='/main_contr/login'>Войти</a>";
			}
		?>	
		</div>
		<div id="body">
			<form method="post" action="/films_contr/film_save" id="addform">
				
				<h1>Добавление фильма</h1>
				<table>
					<tr><td>Название:</td><td><input type="text" name="title" class="validate[required,custom[title]] " id="addel1"/> <br /><br /></td></tr>
					<tr><td>Идентификатор IMDB:</td><td><input type="text" name="imdbid" class="validate[required],custom[imdbid] " id="addel2"/> <br /><br /></td></tr>
					<tr><td>Жанр:</td><td><input type="text" name="genre" class="validate[required],custom[title] " id="addel3"/> <br /><br /></td></tr>
					<tr><td>Описание:</td><td><input type="text" name="description" class="validate[required],custom[desc] " id="addel4"/> <br /><br /></td></tr>				
					<tr><td colspan="2" align="center"><input type="submit" value="Сохранить" name="sub" /></td></tr>
				</table>
			</form>
		</div>
		<!--<p id="notice"></p>-->
		<p id="footer">Разработал Утехин Е.А. 2012</p>
	</div>

</body>
</html>